package com.pray.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * <p>
 * ResourcesConfig
 * <p>
 *
 * @author 春江花朝秋月夜
 * @since 2023/8/24
 */
@Configuration
public class ResourcesConfig implements WebMvcConfigurer {
    //解决跨域
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowCredentials(true)
                .allowedHeaders("*")
                .allowedMethods("GET","POST","PUT","DELETE")
                .allowedOriginPatterns("*");
    }
}
